class CreateGlobalCourse < ActiveRecord::Migration
  def self.up
    u = User.new(:login => 'global_events', :password => 'globBal_eVent_', :password_confirmation => 'globBal_eVent_', :email => 'changeme@example.com', :kind => 'Instructor')
    u.save!
    p = Profile.new(:real_name => 'Este usuario puede editar los eventos globales', :user => u)
    p.user = u
    p.save!

    c = Course.new
    c.id = 0
    c.creator = u
    c.name = 'Eventos Globales'
    c.description = 'Los eventos que se añadan a esta clase van a estar disponibles para todos'
    c.save!
  end

  def self.down
    #User.find_by_login('global_events').profile.destroy
    Course.find_by_name('Eventos Globales').destroy
    User.find_by_login('global_events').destroy
  end
end
